package cn.kongwg.service.impl;

import cn.kongwg.bean.Book;
import cn.kongwg.dao.BookDao;
import cn.kongwg.dao.impl.BookDaoImpl;
import cn.kongwg.service.BookService;

import java.util.List;

/**
 * @author kongwg
 * @create 2021-01-26 10:20
 */
public class BookServiceImpl implements BookService {
    private BookDao dao = new BookDaoImpl();

    @Override
    public void addBook(Book book) {
        dao.addBook(book);
    }

    @Override
    public void delectBook(Integer id) {
        dao.deleteBook(id);
    }

    @Override
    public void updateBook(Book book) {
        dao.updateBook(book);
    }

    @Override
    public Book queryByid(Integer id) {

        return dao.queryBookById(id);
    }

    @Override
    public List<Book> queryList() {
        return dao.queryForAll();
    }
}
